#pragma once
#include <iostream>
#include <windows.h>
using std::cout;
using std::cin;
using std::endl;
std::ostream& operator<<(std::ostream& Ostr, COORD Val);
std::ostream& operator<<(std::ostream& Ostr, SMALL_RECT Val);
class PEN
{
private:
    HANDLE hOut;
    WORD wAttr;
public:
    PEN();
    PEN(HANDLE);
    void NewLine();
    BOOL GetCursorPos(COORD& lp);
    BOOL SetCursorPos(COORD p);
    BOOL Write(const char* str);
    BOOL Write(char ch);
    BOOL Write(WORD wAttr, const char* str);
    BOOL Write(WORD wAttr, char ch);
    BOOL Write(COORD, const char* str);
    BOOL Write(COORD wAttr, char ch);
    BOOL Write(WORD wAttr, COORD, const char* str);
    BOOL Write(WORD wAttr, COORD, char ch);
    BOOL SetColor(WORD wAttr);
    BOOL GetColor(WORD wAttr);
};